package two;

public class CityGate {
    private Guard guard;

//    属性注入
    public void setGuard(Guard guard) {
        this.guard = guard;
    }

    public void ask() {
        System.out.println("城门守卫：来者何人？");
        System.out.println("墨者革离：" + guard.say());
    }
}